from boundaryFinder import *
from visualization import *
import cv2
import numpy as np

def getBoundedBox(image):
    (lc,rc,tr,br) = getIncisorBoundary(image)
    
    height = br - tr
    width = rc - lc
    
    
    side = max(height,width)
    boxedImage = np.zeros((side+1,side+1),np.uint8)
    for i in range(0,side+1):
        for j in range(0,side+1):
            if(tr+i < image.shape[0] and lc+j < image.shape[1]):
                boxedImage[i,j] = image[tr+i,lc+j]
            else:
                boxedImage[i,j] = 0
    return boxedImage
